﻿using MediatR;
using SheepStorage.API.Application.Command.SheepHybridizationCommand;
using SheepStorage.API.Baseclass;
using SheepStorage.Service.Interface;

namespace SheepStorage.API.Application.CommandHandlers.SheepHybridizationCommandHandler
{
    public class UpdCheckCommandHandler : IRequestHandler<UpdCheckCommand, Results<int>>
    {
        ISheepHybridizationService _res;

        public UpdCheckCommandHandler(ISheepHybridizationService res)
        {
            _res = res;
        }

        public async Task<Results<int>> Handle(UpdCheckCommand request, CancellationToken cancellationToken)
        {
            var list =await _res.UpdCheck(request.ids, request.uname);
            return Results<int>.DataResult(list);
        }
    }
}
